﻿<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>@smartcrm.Controllers.BaseController.APPLICATION_NAME</title>
        <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
        <meta name="viewport" content="width=device-width" /> 
        
        @Scripts.Render("~/bundles/jquery")
        @RenderSection("scripts", required: false)
        @Scripts.Render("~/bundles/jqueryui")
        @Scripts.Render("~/bundles/jqueryform")
        @Scripts.Render("~/bundles/common")
        @Scripts.Render("~/bundles/inputmask")
        @Scripts.Render("~/bundles/ajaxfileupload")

        @Styles.Render("~/Content/themes/base/css")    
        @Styles.Render("~/Content/css")
        @Scripts.Render("~/bundles/modernizr")
    </head>
    <body>
        <header>
            <div class="content-wrapper">
                <div class="float-left">
                    <p class="site-title">@smartcrm.Controllers.BaseController.APPLICATION_NAME</p>
                </div>
                <div class="float-right">
                    <section id="login">
                        @Html.Partial("_LoginPartial")
                    </section>                   
                </div>
               <div class="navigation-container">
                 <div  class="main-navigation">
                    <ul>
                    @if (Session["LoginUser"] != null)
                    {                        
                        smartcrm.Models.LoginUser user = Session["LoginUser"] as smartcrm.Models.LoginUser;
                        if (user.PermissionList.Where(m => m.StartsWith("P01")).Count() > 0)
                        {  
                            <li><a>客户联系人</a>
                                <ul>
                                    @if (user.PermissionList.Contains("P0101") || user.PermissionList.Contains("P0102") || user.PermissionList.Contains("P0103") ||user.PermissionList.Contains("P0107"))
                                    {
                                        <li><a href='/Customer/Index'>客户管理</a></li> 
                                    }
                                     @if (user.PermissionList.Contains("P0104") || user.PermissionList.Contains("P0105") || user.PermissionList.Contains("P0106"))
                                    {
                                        <li><a href='/Contact/Index'>联系人管理</a></li>  
                                    }                             
                                </ul>
                            </li>   
                        }
                            if (user.PermissionList.Where(m => m.StartsWith("P02")).Count() > 0)
                            {                                
                             <li><a>订单管理</a>
                                <ul>
                                    @if (user.PermissionList.Contains("P0201"))
                                    {
                                        <li><a href='/Order/Index'>订单查询</a></li>                                                                    
                                    }
                                    @if (user.PermissionList.Contains("P0202"))
                                    {
                                        <li><a href='/Order/Create'>新建订单</a></li>     
                                    }
                                    @if (user.PermissionList.Contains("P0301"))
                                    {
                                        <li><a href='/Order/CustomerStatement'>客户对账单</a></li>                                        
                                    }
                                    @if (user.PermissionList.Contains("P0302"))
                                    {
                                        <li><a href='/Order/FactoryStatement'>加工商对账单</a></li>                                        
                                    }
                                </ul>
                            </li>                                
                            }
                            if (user.PermissionList.Where(m => m.StartsWith("P04")).Count() > 0)
                            {                                                   
                            <li><a>系统管理</a>
                                <ul>
                                    @if (user.PermissionList.Contains("P0401"))
                                    {
                                        <li><a href='/System/Company'>公司资料</a></li>   
                                     }
                                    <!-- <li><a href='/System/Department'>部门管理</a></li> -->
                                    @if (user.PermissionList.Contains("P0402"))
                                    {
                                        <li><a href='/System/User'>用户管理</a></li>     
                                    }
                                     @if (user.PermissionList.Contains("P0403"))
                                    {
                                        <li><a href='/System/OrderTemplate'>模板设置</a></li>  
                                    }
                                    @if (user.PermissionList.Contains("P0404"))
                                    { 
                                        <li><a href='/System/WorkFlow'>流程设置</a></li>   
                                    }
                                    @if (user.PermissionList.Contains("P0405"))
                                    { 
                                        <li><a href='/System/List'>列表配置</a></li>      
                                    }
                                    @if (user.PermissionList.Contains("P0406"))
                                    {
                                        <li><a href='/System/Factory'>加工商管理</a></li>                                    
                                    }
                                </ul>
                            </li>  
                            }
                            <li><a>个人中心</a>
                                <ul>
                                    @if (user.PermissionList.Contains("P0206"))
                                    {
                                        <li><a href='/Order/UnApprovedOrder'>待确认订单</a></li> 
                                    }  
                                    <li><a href='/MySpace/Index'>我的任务</a></li>   
                                    <li><a href='/MySpace/ChangePassword'>更改密码</a></li>  
                                    <li><a href='/Home/ReportBug'>报告问题</a></li>                                   
                                </ul>
                            </li>                             

                       
                    }  
                       @* <li><a>帮助信息</a>
                            <ul>                                
                                                    
                                <li><a style="color:#bbbbbb" href='#'>文档下载</a></li>
                            </ul>
                        </li>   *@
                     </ul>                     
                    </div>
               </div>
            </div>
        </header>
        <div id="body">
            @RenderSection("featured", required: false)
            <section class="content-wrapper main-content clear-fix">
                @RenderBody()
            </section>
        </div>
        <footer>
            <div class="content-wrapper">
                <center style="color:#939393">
                    <p>
                        &copy; @DateTime.Now.Year - @smartcrm.Controllers.BaseController.APPLICATION_NAME&nbsp;&nbsp;&nbsp;&nbsp;版本：@smartcrm.Controllers.BaseController.APPLICATION_VERSION                   
                        &nbsp;&nbsp; 建议采用Internet Explorer 11及以上版本
                    </p>
                </center>                               
            </div>
        </footer>

        
        <div id="iframeDiv" style=" display:none">
            <iframe src="/Home/State" height="0" width="0"></iframe>
        </div>
    </body>
</html>
